export class StringUtils {
  /**
   * 字符串转驼峰
   * @param str
   * @param delimiter
   */
  static toCamelCase(str: string, delimiter: string = '-'): string {
    return str.replace(new RegExp(delimiter + '(\\w)', 'g'), (match, p1) =>
      p1.toUpperCase(),
    );
  }

  /**
   * 字母转大写
   * @param str
   */
  static capitalize(str: string): string {
    return str.charAt(0).toUpperCase() + str.slice(1);
  }
}
